<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ include file="/WEB-INF/jsp/common/taglib.jsp"%>
<%@ page session="true" %> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>productsales_reports_page</title>

<script src="<c:url value="/ui/jquery-1.10.2.js" />"></script>
<script src="<c:url value="/ui/jquery-migrate-1.2.1.js" />"></script>


<script>
	var contextPath = <c:url value="/"/>
</script>

<link rel="stylesheet" href="<c:url value="/demo/jquery.ui.all.css"/>">
<link href="<s:url value="/css/standard.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/pop_up.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/maintenance.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/Simplemodal.css" />" rel="stylesheet"
	type="text/css" />

<script src='<c:url value="/js/jquery.DynamicMessage.js" />'></script>
<script src='<c:url value="/js/jquery.simplemodal-1.4.1.js" />'></script>

<script src='<c:url value="/js/common.js" />'></script>
<script src='<c:url value="/js/common_ui.js" />'></script>
<script src='<c:url value="/js/poplayer.js" />'></script>
<script src='<c:url value="/js/maint_ui.js" />'></script>
<script src='<c:url value="/js/jquery.form.js" />'></script>


<script src="<c:url value="/ui/jquery.ui.core.js" />"></script>
<script src="<c:url value="/ui/jquery.ui.widget.js" />"></script>
<script src="<c:url value="/ui/jquery.ui.datepicker.js" />"></script>
<!--  <script src="<c:url value="/ui/jquery-ui-timepicker-addon.js" />"></script>-->

<script src='<c:url value="/js/jquery.simplemodal-1.4.1.js" />'></script>

<script src="<c:url value="/ui/exporting.js" />"></script>
<script src="<c:url value="/ui/exporting.src.js" />"></script>
<script src="<c:url value="/ui/highcharts.js" />"></script>
<script src="<c:url value="/ui/highcharts.src.js" />"></script>
<script src="<c:url value="/ui/highcharts-3d.js" />"></script>
<script src="<c:url value="/ui/highcharts-3d.src.js" />"></script>

<script src="<c:url value="/ui/jquery-ui-slide.min.js" />"></script>
<link rel="stylesheet" href="<c:url value="/demo/demos.css" />">
<link rel="stylesheet" href="<c:url value="/demo/dateTime.css" />">
</head>
<body>
	<input type="hidden" value="${ conditionQuery.year }" id="conYear">
	<input type="hidden" value="${ conditionQuery.mon }" id="conMon">
	<div class="search">
		<form:form method="get" name="searchForm">
			<table id="radiotable" class="mainGrid" width="100%" border="0"
				cellpadding="0" cellspacing="0">
				<thead>
					<tr>
						<th colspan="4" class="mainFormTitle">根据年月查询报表</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td height="35px"><select name="year" id="year"
							style="width: 80px;">
						</select> 年 <select name="mon" id="mon" style="width: 80px;"></select> 月 <input
							type='submit' onclick="search()" value=' 查询 ' /></td>

					</tr>
				</tbody>

			</table>
		</form:form>
	</div>

	<div class="Info">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="7" align="left" valign="top" height="7"><img
					src="<s:url value="/images/corner_left_top_m.gif"/>" width="7"
					height="7" /></td>
				<td class="topBorderMain"><img
					src="<s:url value="/images/spacer.gif" />" /></td>
				<td width="7" align="right" valign="top"><img
					src="<s:url value="/images/corner_right_top_m.gif" />" /></td>
			</tr>

			<tr>
				<th colspan="4" class="mainFormTitle">产品销售报表</th>
			</tr>
			<tr>
				<td colspan="4" class="mainFormTitle" width="100%" align="center"
					style="font-size: 20px; font-weight: bolder;" id="title"><c:if
						test="${conditionQuery.year==null }">${dateYear}</c:if> <c:if
						test="${conditionQuery.year!=null }">${conditionQuery.year}</c:if>
					年 <c:if test="${conditionQuery.mon!=null }">${ conditionQuery.mon }</c:if>
					<c:if test="${conditionQuery.mon==null}">${dateMon}</c:if> 月 产品销售报表</td>
			</tr>
			<tr>
				<td colspan="4" class="leftRightBorderMain">


					<table id="radiotable" class="mainGrid" width="100%" border="0"
						cellpadding="0" cellspacing="0">
						<thead>
							<tr>

								<th width="15%">名称</th>
								<th width="15%">当月总金额</th>
								<th width="35%">本月度百分比（本产品当月售额/本月销售总金额）</th>
								<th width="35%">全年度百分比（本产品当月售额/本年所有产品销售总金额）</th>

							</tr>
						</thead>
						<tbody>
							<c:forEach items="${ list }" var="map" varStatus="status">

								<tr id="radiotable_tr_<c:out value="${status.index}"/>">

									<td align='center' style="word-break: break-all;"
										class="product_name"><c:out value="${ map['name'] }" /></td>

									<td align='center' style="word-break: break-all;"><c:out
											value="${ map['cost'] }" /></td>

									<td align='center' style="word-break: break-all;"
										class="prduct_monPercent"><c:out
											value="${ map['monPercent'] }" /></td>

									<td align='center' style="word-break: break-all;"
										class='prduct_yearPercent'><c:out
											value="${ map['yearPercent'] }" /></td>
									</td>

								</tr>
							</c:forEach>

							<c:if test="${ list == null || fn:length(list) == 0}">
								<tr id="radiotable_tr_<c:out value="${status.index}"/>">
									<td colspan='99' align='center'><font color='red'>no
											recored.</font></td>
								</tr>
							</c:if>

						</tbody>
					</table>
				</td>
			</tr>
			<tr height="20px"></tr>
			<tr>
				<td colspan="4" class="leftRightBorderMain">
					<table id="radiotable" class="mainGrid" width="100%" border="0"
						cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th width="35%">本月所有产品销售总金额(元/人民币)</th>
								<th width="35%">本年所有产品销售总金额(元/人民币)</th>

							</tr>
						</thead>
						<tbody>
							<tr id="radiotable_tr_p">

								<td align='center' style="word-break: break-all;"><c:out
										value="${ thatMonSum }" /></td>

								<td align='center' style="word-break: break-all;"><c:out
										value="${ thatYearSum }" /></td>

							</tr>
						</tbody>

					</table>
				</td>
			</tr>
			<tr height="20px"></tr>
			<tr>
				<th colspan="4" class="mainFormbtn"></th>
			</tr>
			<tr></tr>
			<tr>
				<td align="left" valign="bottom" height="7" width="7"><img
					src="<s:url value="/images/corner_left_bottom_m.gif"/>" /></td>
				<td class="bottomBorderMain"><img
					src="<s:url value="/images/spacer.gif"/>" /></td>
				<td align="right" valign="bottom" height="7" width="7"><img
					src="<s:url value="/images/corner_right_bottom_m.gif"/>" /></td>
			</tr>
		</table>

	</div>
	<p style="height: 20px"></p>
	<div id="total" style="width: 100%">
		<div align="center" style="width: 50%; float: left;">
			<p style="font-size: 20px">本月度百分比(本产品当月售额/本月销售总金额)</p>
		</div>
		<div align="center" style="width: 50%; float: left;">
			<p style="font-size: 20px">全年度百分比(本产品当月售额/本年所有产品销售总金额)</p>
		</div>
		<div id="container" style="height: 400px; width: 50%; float: left;"></div>
		<div id="container2" style="height: 400px; width: 50%; float: left;"></div>
	</div>


	<script src="<c:url value="/js/productsales_reports_page.js" />"></script>

</body>
</html>